package scalapackage

/**
  * Created by Germmy on 2018/3/11.
  * 元组
  */
object TupleTest {
  def main(args: Array[String]): Unit = {


    //1. 新建一个元组
    val t=(("tingting",18),("ningning",20),("xiaoyueyue",19))

//    println(t)

    //打印xiaoyueyue的年纪

//    println(t._3._2)


    //建立一个混合的元组
    val t2=("scala",3.14,18L,("china",100))


//    println(t2)

    //将china打印出来
//    println(t2._4._1)


    //数组转map
    val arr5=Array(("tingting",18),("ningning",20),("xiaoyueyue",19))

    //拉链操作

    val arr1=Array("tingting","ningning","xiaoyueyue")
    val arr2=Array(18,30,19,40)

    val arr3=arr1.zip(arr2)


//      for(i<- arr3){
//        println(i)
//      }

//    println(arr3)
//    println(arr1)
//    arr1 zip arr2


    val map1=arr5.toMap
    println(map1)



    }
  }
